

//Nav.ios5 = 
$(function(){
	initNav();
//	fitPageToScreen();
//	window.addEventListener("orientationchange", fitPageToScreen);
});

var Nav ={
	browserDiffOffset: 0,
	isOS5_0:false
};

function initNav(){
	var userAgent = navigator.userAgent.toLowerCase();
	Nav.isOS5_0 = /5_0_/.test(userAgent);
	if(Nav.isOS5_0)Nav.browserDiffOffset = 30;
}

function isLandscape(){
	switch(window.orientation) {
	case 0:
	case 180:
		return false;
	};
	return true;
}

function fitPageToScreen(){
	if(Nav.isOS5_0){
		if(isLandscape()){
			$(".nipad").css({"height": "644px"});
		}else{
			$(".nipad").css({"height": "900px"});
		}
		$(".nipadBtmR").css({"margin-top": "-20px"});
	}
	
}